﻿//===================================================================================
// Copyright (c) Ryan Garrett.  All rights reserved.
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===================================================================================
using System;

namespace Caffeine.Core
{
    /// <summary>
    /// The different behaviors implemented by model properties
    /// </summary>
    [Flags]
    public enum ModelPropertyBehaviors
    {
        /// <summary>
        /// Causes a model property to change it's IsDirty property to true when it's Value property has been changed
        /// </summary>
        SetsIsDirty = 1,

        /// <summary>
        /// Causes a model property to change it's parent's IsDirty property to true when it's Value property has been changed
        /// </summary>
        SetsParentIsDirty = 2,

        /// <summary>
        /// Causes a model property to change it's IsInvalid property to true when it is considered invalid
        /// </summary>
        SetsIsInvalid = 4,

        /// <summary>
        /// Causes a model property to change it's parent's IsInvalid property to true when it is considered invalid
        /// </summary>
        SetsParentIsInvalid = 8,

        /// <summary>
        /// Determines whether or not a model will reset this property when ModelBase.Reset() is called
        /// </summary>
        IsResettable = 16,

        /// <summary>
        /// Every time the Value property of a model property changes, it will trigger a property change count increment if its parent's PropertyChangeCounter property is set
        /// </summary>
        SupportsPropertyChangeCounting = 64
    }
}
